#include "MenuEsperando.h"
#include <iostream>
MenuEsperando::MenuEsperando(Socket *socket)
{
	Glib::RefPtr<Gtk::Builder> refBuilder = Gtk::Builder::create();
	refBuilder->add_from_file("./Cliente/Esperando.glade");

	refBuilder->get_widget("Esperando", main);
	main->signal_event_after().connect(sigc::mem_fun(*this, &MenuEsperando::on_my_event_after));

	main->show_all_children();
	
	this->socket = socket;
}

void MenuEsperando::correr() {
	Gtk::Main::run(*main);
}

MenuEsperando::~MenuEsperando()
{
	
}
void MenuEsperando::on_my_event_after(GdkEvent* event) {
	if (GDK_ENTER_NOTIFY == event->type){
		rcv = this->socket->recibir();
		main->hide();
	}
}
